﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucListAlbum.ascx.cs" Inherits="QuocTeViet.AdminCP.PageUC.ucListAlbum" %>
<asp:Panel ID="pn" runat="server" Visible="true">
<h2>Danh sách Album</h2>
<div style="width:90%; float:left; margin-bottom:10px;">
    Lựa chọn theo Danh mục: 
    <asp:DropDownList ID="cboCategory" runat="server"  AutoPostBack="True" onselectedindexchanged="cboCategory_SelectedIndexChanged"></asp:DropDownList>
    <br />
    <asp:GridView ID="gvAt" DataKeyNames="AlbumID" runat="server" 
        AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" 
    BorderStyle="None" BorderWidth="1px" CellPadding="4" 
        onrowdeleting="gvAt_RowDeleting" 
        onselectedindexchanged="gvAt_SelectedIndexChanged" PageSize="100" Width="100%" 
        onrowcommand="gvAt_RowCommand">
    <RowStyle BackColor="White" ForeColor="#330099" />
    <Columns>
        <asp:TemplateField HeaderText="STT">
            <ItemTemplate>
                <%# Container.DataItemIndex + 1 %>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
        <asp:BoundField DataField="Title" HeaderText="Tiêu đề" SortExpression="Title" />
        <asp:BoundField DataField="eTitle" HeaderText="Tiêu đề TA" SortExpression="CateTitle" />
        <asp:BoundField DataField="CategoryID" HeaderText="Danh mục" SortExpression="CategoryID" />
        <asp:CheckBoxField DataField="Type" HeaderText="Video" />
        <asp:TemplateField HeaderText="Ảnh Video">
            <ItemTemplate>
                <asp:Image ID="imgVideo" ImageUrl='<%#"~/Media/" + Eval("CoverImg") %>' runat="server" Width="100px" Height="60px" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:ImageButton ID="btEdit" runat="server" CommandName="Select" CommandArgument='<%#Eval("AlbumID") %>' ImageUrl="~/AdminCP/images/edit_16x16.gif" />
                <asp:ImageButton ID="btDelete" runat="server" CommandArgument='<%#Eval("AlbumID") %>'
                    CommandName="Delete" ImageUrl="~/AdminCP/images/delete_16x16.gif" OnClientClick="return confirm('Có muốn xóa bản ghi này? Nhấn OK để xóa!')" />
                <%--<asp:Button ID="btnChiTiet" runat="server" CommandName="chitiet" CommandArgument='<%#Eval("AlbumID") %>' Text="Chi tiết" />--%>
                <asp:LinkButton ID="btnChiTiet" runat="server" CommandName="chitiet" CommandArgument='<%#Eval("AlbumID") %>' Text="Chi tiết"></asp:LinkButton>
            </ItemTemplate>
        </asp:TemplateField>
                    
    </Columns>
    <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
    <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
    <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
    <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
</asp:GridView>
<br />
<asp:Button ID="btnAdd" runat="server" onclick="btnAdd_Click" Text="Thêm mới" />

</div>
</asp:Panel>
<asp:Panel id="pnSP" runat="server" Visible="false">
    <h2>Danh sách Album Sản Phẩm</h2>
<div style="width:90%; float:left; margin-bottom:10px;">
    <asp:GridView ID="grSP" DataKeyNames="AlbumID" runat="server" 
        AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" 
    BorderStyle="None" BorderWidth="1px" CellPadding="4" 
        onrowdeleting="gvSP_RowDeleting" 
        onselectedindexchanged="gvSP_SelectedIndexChanged" PageSize="100" Width="100%" 
        onrowcommand="gvSP_RowCommand">
    <RowStyle BackColor="White" ForeColor="#330099" />
    <Columns>
        <asp:TemplateField HeaderText="STT">
            <ItemTemplate>
                <%# Container.DataItemIndex + 1 %>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>
        <asp:BoundField DataField="Title" HeaderText="Tiêu đề" SortExpression="Title" />
        <asp:BoundField DataField="eTitle" HeaderText="Tiêu đề TA" SortExpression="CateTitle" />
        <asp:BoundField DataField="TenSanPham" HeaderText="Sản Phẩm" SortExpression="TenSanPham" />
        <asp:CheckBoxField DataField="Type" HeaderText="Video" />
        <asp:TemplateField HeaderText="Ảnh Video">
            <ItemTemplate>
                <asp:Image ID="imgVideo" ImageUrl='<%#"~/Media/" + Eval("CoverImg") %>' runat="server" Width="100px" Height="60px" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:ImageButton ID="btEdit" runat="server" CommandName="Select" CommandArgument='<%#Eval("AlbumID") %>' ImageUrl="~/AdminCP/images/edit_16x16.gif" />
                <asp:ImageButton ID="btDelete" runat="server" CommandArgument='<%#Eval("AlbumID") %>'
                    CommandName="Delete" ImageUrl="~/AdminCP/images/delete_16x16.gif" OnClientClick="return confirm('Có muốn xóa bản ghi này? Nhấn OK để xóa!')" />
                <%--<asp:Button ID="btnChiTiet" runat="server" CommandName="chitiet" CommandArgument='<%#Eval("AlbumID") %>' Text="Chi tiết" />--%>
                <asp:LinkButton ID="btnChiTiet" runat="server" CommandName="chitiet" CommandArgument='<%#Eval("AlbumID") %>' Text="Chi tiết"></asp:LinkButton>
            </ItemTemplate>
        </asp:TemplateField>
                    
    </Columns>
    <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
    <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
    <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
    <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
</asp:GridView>
<br />
<asp:Button ID="Button1" runat="server" onclick="btnAddSP_Click" Text="Thêm mới" />

</div>
</asp:Panel>

